import React, { useState } from 'react'
import { Table, Tag, Modal, Popover, Button, Switch } from 'antd';

export default function Rightlist() {
  const [dataSource, setDataSource] = useState([])
  const columns=[
    {
      title: 'ID',
      dataIndex: 'id',
    },
    {
      title: '权限名称',
      dataIndex: 'title',
    },
    {
      title: '权限路径',
      dataIndex: 'key',
      render: (key) => {
        return <Tag color="orange">{key}</Tag>
      }
    },
    // {
    //   title: '操作',
    //   render: (key) => {
    //     return <div>
    //       <Button type="danger" shape="circle" onClick={() => { this.showConfirm(key) }} icon={<DeleteOutlined />} />
    //       <Popover content={
    //         <div><Switch checked={key.pagepermisson == 1} onChange={()=>this.switchMethod(key)}></Switch></div>
    //       } title="页面配置项" trigger={key.pagepermisson === undefined?'':"click"} >
    //         <Button type="primary" shape="circle" icon={<EditOutlined />} disabled={key.pagepermisson === undefined} />
    //       </Popover>
    //     </div>
    //   }
    // },
  ]
  return (
    <div>
      <Table dataSource={this.state.dataSource} columns={columns} pagination={
        { pageSize: 5 }
      } />;
    </div>
  )
}
